package tds.model2.version2;

public enum CashType {
	NOMAL(0, "正常收费"),
	SIX_DISCOUNT(1, "6折"),
	EIGHT_DISCOUNT(2, "8折"),
	NINE_DISCOUNT(3, "9折"),
	CONDITION_RETURN(4, "满300返100");
	
	private CashType(int code, String descript){
		this.code = code;
		this.descript = descript;
	}
	
	private int code;
	
	private String descript;

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getDescript() {
		return descript;
	}

	public void setDescript(String descript) {
		this.descript = descript;
	}
	
	public static CashType valueOf(int code){
		for(CashType type : values()){
			if(type.getCode() == code){
				return type;
			}
		}
		return null;
	}
	
}
